<?php
namespace BP\Sys\FrmUI;
require_once("BP/En/Map.php");
class FrmBtn extends EntityMyPK {
	public function getFK_MapData () 
	{
		return $this->GetValStrByKey(FrmBtnAttr::$FK_MapData);
	}
	public static function constructor__ () 
	{
		$me = new self();
		return $me;
	}
	public static function constructor__String ($mypk) // [String mypk]
	{
		$me = new self();
		$me->setMyPK($mypk);
		$me->Retrieve();
		return $me;
	}
	public function getEnMap () 
	{
		if (($this->get_enMap() != NULL))
		{
			return $this->get_enMap();
		}
		$map = new Map("Sys_FrmBtn", "按钮");
		$map->Java_SetDepositaryOfEntity($Depositary->None);
		$map->Java_SetDepositaryOfMap($Depositary->Application);
		$map->Java_SetEnType($EnType->Sys);
		$map->IndexField = MapAttrAttr::$FK_MapData;
		$map->AddMyPK();
		$map->AddTBString(FrmBtnAttr::$FK_MapData, NULL, "表单ID",  TRUE ,  FALSE , 1, 100, 20);
		$map->AddTBString(FrmBtnAttr::$Text, NULL, "标签",  TRUE ,  FALSE , 0, 3900, 20);
		$map->AddTBInt(FrmBtnAttr::$IsView, 0, "是否可见",  FALSE ,  FALSE );
		$map->AddTBInt(FrmBtnAttr::$IsEnable, 0, "是否起用",  FALSE ,  FALSE );
		$map->AddTBInt(FrmBtnAttr::$UAC, 0, "控制类型",  FALSE ,  FALSE );
		$map->AddTBString(FrmBtnAttr::$UACContext, NULL, "控制内容",  FALSE ,  FALSE , 0, 3900, 20);
		$map->AddDDLSysEnum(FrmBtnAttr::$EventType, 0, "事件类型",  TRUE ,  TRUE , FrmBtnAttr::$EventType, "@0=禁用@1=执行URL@2=执行CCFromRef.js");
		$map->AddTBString(FrmBtnAttr::$EventContext, NULL, "事件内容",  TRUE ,  FALSE , 0, 3900, 20);
		$map->AddTBString(FrmBtnAttr::$MsgOK, NULL, "运行成功提示",  TRUE ,  FALSE , 0, 500, 20);
		$map->AddTBString(FrmBtnAttr::$MsgErr, NULL, "运行失败提示",  TRUE ,  FALSE , 0, 500, 20);
		$map->AddTBString(FrmBtnAttr::$BtnID, NULL, "按钮ID",  TRUE ,  FALSE , 0, 128, 20);
		$map->AddDDLSQL(FrmBtnAttr::$GroupID, 0, "�?在分�?", "SELECT OID as No, Lab as Name FROM Sys_GroupField WHERE FrmID='@FK_MapData'",  TRUE );
		$this->set_enMap($map);
		return $this->get_enMap();
	}
	protected function afterInsertUpdateAction () 
	{
		$frmBtn = FrmBtn::constructor__();
		$frmBtn->setMyPK($this->getMyPK());
		$frmBtn->RetrieveFromDBSources();
		$frmBtn->Update();
		CCFormAPI->AfterFrmEditAction($this->getFK_MapData());
		parent->afterInsertUpdateAction();
	}
	protected function afterDelete () 
	{
		CCFormAPI->AfterFrmEditAction($this->getFK_MapData());
		parent->afterDelete();
	}
}
?>
